import 'package:flutter/material.dart';

import '../../../components/people_team.dart';

class Member extends StatelessWidget {
  List members = [
    {
      "name": "dx",
      "imgurl":
          "https://img1.doubanio.com/view/group_topic/l/public/p350891968.webp"
    },
    {
      "name": "xx",
      "imgurl":
          "https://img1.doubanio.com/view/group_topic/l/public/p350891968.webp"
    },
    {
      "name": "xx",
      "imgurl":
          "https://img1.doubanio.com/view/group_topic/l/public/p350891968.webp"
    },
    {
      "name": "xx",
      "imgurl":
          "https://img1.doubanio.com/view/group_topic/l/public/p350891968.webp"
    },
    {
      "name": "...",
      "imgurl":
          "https://img1.doubanio.com/view/group_topic/l/public/p350891968.webp"
    }
  ];
  Member({
    Key key,
  }) : super();

  Widget buildPeople(Map e) {
    if (e["name"] == "...") {
      return Container(
        decoration: BoxDecoration(borderRadius: BorderRadius.circular(100)),
        margin: EdgeInsets.only(left: 8),
        child: Text(
          "...",
          style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20),
        ),
      );
    }
    return Container(
      margin: EdgeInsets.only(right: 18),
      child: PeopleTeam(
        name: e["name"],
        imgurl: e["imgurl"],
      ),
    );
  }

  @override
  Widget build(BuildContext context) {
    return Container(
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          Container(
            padding: EdgeInsets.only(left: 8),
            child: Text(
              "团队成员",
              style: TextStyle(
                fontWeight: FontWeight.bold,
                fontSize: 18,
              ),
            ),
          ),
          SizedBox(
            height: 5,
          ),
          Divider(
            color: Colors.red,
            height: 5,
            thickness: 10,
          ),
          Container(
            padding: EdgeInsets.only(left: 8),
            child: Row(
              children: this
                  .members
                  .map((e) => e["name"] != "..."
                      ? Container(
                          margin: EdgeInsets.only(right: 18),
                          child: PeopleTeam(
                            name: e["name"],
                            imgurl: e["imgurl"],
                          ),
                        )
                      : Container(
                          decoration: BoxDecoration(
                              borderRadius: BorderRadius.circular(100)),
                          margin: EdgeInsets.only(left: 8),
                          child: Text(
                            "...",
                            style: TextStyle(
                                fontWeight: FontWeight.bold, fontSize: 30),
                          ),
                        ))
                  .toList(),
            ),
          ),
          Divider(
            color: Colors.red,
            height: 5,
            thickness: 10,
          )
        ],
      ),
    );
  }
}
